{extends file="global.html"}

{block name=global}
<div class="admin_message">
    <div class="notification success">
    	<div>设置成功</div>
    </div>
    
    <div class="redirect layui-btn-group">
        <a class="javascript redirect_selection  hidden layui-btn layui-btn layui-btn-danger" id="rs_close">关闭窗口</a>
        <a href="{url('lists',['parent_id'=>$args.parent_id])}" id="rs_return" class="redirect_selection  layui-btn hidden layui-btn-normal layui-btn-danger">返回列表</a>
     </div>
    {$auto=3}
    {if $auto}
    <div class="count_down hidden">
    	系统将在<span id="count_down_count">{$auto}</span>秒后自动关闭窗口
    </div>
    
    <script>
    	var left_seconds=parseInt('{$auto}');
    	function count_down(){
    		if(left_seconds<0){
                $('#rs_close').trigger('click') ;
    			return;
    		}
    		$('#count_down_count').html(left_seconds--);
    		count_down.timeout=window.setTimeout(count_down,1000);
    	}
    	$(document).ready(function(){ count_down(); });
    	$('#cancel_count_down').click(function(){
    		window.clearTimeout(count_down.timeout);
    		$(this).parent().remove();
    	})
    	
    </script>
    {/if}
    <script type="text/javascript">
    $(document).ready(function(){
        if(self != parent){            
            $('.count_down').show() ;
            $('#rs_close').css('display','inline-block').click(function(){
                //top.$('.layui-tab').find('.layui-tab-title li.layui-this .layui-tab-close').trigger('click');
                parent.layer.closeAll();
                parent.location.reload();
            }); 
        }else{
            $('#rs_return').css('display','inline-block');
        }
          
        
    })
    </script>
</div>
{/block}
